home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_hyenambient.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  52 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_RandomAmbient.cog
  4. #
  5. # Plays a random sound at random intervals with random volume and panning
  6. #
  7. # [SXC]    + [RKD]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. message    startup
  14. message    timer
  15.  
  16. sound    hyenawav0=pyr_amb_hyena_1.wav    local
  17. sound    hyenawav1=pyr_amb_hyena_2.wav    local
  18. sound    hyenawav2=pyr_amb_hyena_3.wav    local
  19. sound    hyenawav3=pyr_amb_hyena_4.wav    local
  20.  
  21. flex    minInterval=5        local
  22. flex    rangeInterval=15    local
  23. flex    minVolume=0.4        local
  24. flex    rangeVolume=1.2        local
  25.  
  26. int        cursound=0
  27. end
  28.  
  29. code
  30.  
  31. # ........................................................................................
  32.  
  33. startup:
  34.     SetTimer(20);
  35.     
  36.     return;
  37.  
  38. timer:
  39.     # if all hyenas killed, stop sounds and timer
  40.     if (global8 > 10) return;
  41.     
  42.     # prepare for next sound
  43.     SetTimer(minInterval + (rand() * rangeInterval));
  44.     
  45.     # if player is inside pyramid complex, try again later
  46.     if (global11 == 1) return;
  47.  
  48.     cursound = PlaySoundLocal(hyenawav0[RandBetween(0, 3)], (minVolume + (rand() * rangeVolume)), ((rand() *2) - 1.0), 0x0, 0);
  49.     return;
  50. end
  51.  
  52.